/*
 * Move.h
 *
 *  Created on: Sep 21, 2012
 *      Author: snirgaz
 */

#ifndef MOVE_H_
#define MOVE_H_

#include "SSEConf.h"
#include "HelpLibs/RandomGen.h"
#include "HelpLibs/QmcParameters.h"
#include <boost/range/algorithm.hpp>
#include <boost/foreach.hpp>
#define foreach BOOST_FOREACH

class McMove {
protected:
	SSEConf *sseConf_;
public:
	McMove();
	void DoMove();
};

class DiagonalUpdate: public McMove{
private:
	// Add Probability
	double aprob_;
	// Delete Probability
	double dprob_;
	// J1/J2 ratio
	double alpha_;
	// Uniform [0,1]
	UniformReal rand_;
	// Draw Site
	UniformInt randBond_;
public:
	void DoMove();
	void init(QmcParameters const & qmcParameters,SSEConf *sseConf,MTGen *eng);
};
class LoopUpdate: public McMove{
private:
	vector<Op::Leg *> firstSpinOp_,lastSpinOp_;
	// Uniform [0,1]
	UniformReal rand_;
public:
	void DoMove();
	void bulidVertexList();
	void flipSpins();
	void init(QmcParameters const & qmcParameters,SSEConf *sseConf,MTGen *eng);
};
#endif /* MOVE_H_ */
